package com.vtc.session2;

import com.vtc.R;

import android.app.Activity;
import android.os.Bundle;
import android.text.InputType;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TableLayout.LayoutParams;
import android.widget.TextView;

public class ContactFormActivity extends Activity{

	@Override
	protected void onCreate(Bundle savedInstanceState) {	
		super.onCreate(savedInstanceState);
		LinearLayout layout = new LinearLayout(this);
		layout.setOrientation(LinearLayout.VERTICAL);
		///////////////////
		LinearLayout layout1 = new LinearLayout(this);
		layout1.setOrientation(LinearLayout.HORIZONTAL);
		
		TextView tv1 = new TextView(this);
		tv1.setText("Username");
		EditText etUser = new EditText(this);
		
		LinearLayout.LayoutParams paras = new LayoutParams();
		paras.width = android.widget.LinearLayout.LayoutParams.MATCH_PARENT;
		etUser.setLayoutParams(paras);
		
		layout1.addView(tv1);
		layout1.addView(etUser);
	    //////////////////
		LinearLayout layout2 = new LinearLayout(this);
		layout2.setOrientation(LinearLayout.HORIZONTAL);
		
		TextView tv2 = new TextView(this);
		tv2.setText("Password");
		EditText etPass= new EditText(this);	
		etPass.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
		etPass.setLayoutParams(paras);
		
		layout2.addView(tv2);
		layout2.addView(etPass);
		////////////
		layout.addView(layout1);
		layout.addView(layout2);		
		
		this.setContentView(layout);
	}
}
